class Master:
    """师傅类"""

    def __init__(self):
        self.kongfu = '[古法煎饼果子配方]'

    def make_cake(self):
        print(f'使用{self.kongfu}制作煎饼果子')


class School:
    """学校类"""

    def __init__(self):
        self.kongfu = '[黑马煎饼果子配方]'

    def make_cake(self):
        print(f'使用{self.kongfu}制作煎饼果子')


class Prentice(School, Master):
    """徒弟类"""

    def __init__(self):
        # 定义私有属性
        self.__money = 2000000
        self.kongfu = '[独创煎饼果子配方]'

    # 定义私有方法
    def __info_print(self):
        print(self.kongfu)
        print(self.__money)

    def make_cake(self):
        self.__init__()
        print(f'使用{self.kongfu}制作煎饼果子')

    def make_old_cake(self):
        super().__init__()
        super().make_cake()


class TuSun(Prentice):
    """徒孙类"""
    pass


if __name__ == '__main__':
    daqiu = Prentice()
    # 对象不能访问私有属性和私有方法
    # print(daqiu.__money)
    # daqiu.__info_print()

    xiaoqiu = TuSun()
    # 对象不能访问私有属性和私有方法
    # print(xiaoqiu.__money)
    # xiaoqiu.__info_print()

    print(xiaoqiu.__dict__)
    # 强行访问私有属性和私有方法
    print(xiaoqiu._Prentice__money)
    xiaoqiu._Prentice__info_print()
